package mess;

public class LeeCode_35 {
    public static void main(String[] args) {
        int[] nums = new int[]{1,3,5,6};
        System.out.println(searchInsert(nums, 7));
    }
    private static int searchInsert(int[] nums, int target) {
        int len = nums.length;
        for (int i = 0; i < len; i++) {
            if (target == nums[i] || nums[i] > target)
                return i;
        }
        return len;
    }
}
